package com.ruoyi.develop.goodsSaledoGongxuUserLirun.service.impl;

import java.util.List;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
        import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.ruoyi.develop.goodsSaledoGongxuUserLirun.mapper.GoodsSaledoGongxuUserLirunMapper;
import com.ruoyi.develop.goodsSaledoGongxuUserLirun.domain.GoodsSaledoGongxuUserLirun;
import com.ruoyi.develop.goodsSaledoGongxuUserLirun.service.IGoodsSaledoGongxuUserLirunService;

/**
 * 报工算利润列Service业务层处理
 * @author lmm
 * @date 2025-06-27
 */
@Service
public class GoodsSaledoGongxuUserLirunServiceImpl implements IGoodsSaledoGongxuUserLirunService {
    @Resource
    private GoodsSaledoGongxuUserLirunMapper goodsSaledoGongxuUserLirunMapper;

    /**
     * 查询报工算利润列
     * @param id 报工算利润列主键
     * @return 报工算利润列
     */
    @Override
    public GoodsSaledoGongxuUserLirun selectById(String id) {
        return goodsSaledoGongxuUserLirunMapper.selectById(id);
    }

    /**
     * 查询报工算利润列列表
     * @param entity 报工算利润列
     * @return 报工算利润列
     */
    @Override
    public List<GoodsSaledoGongxuUserLirun> selectList(GoodsSaledoGongxuUserLirun entity) {
        return goodsSaledoGongxuUserLirunMapper.selectList(entity);
    }

    /**
     * 新增报工算利润列
     * @param entity 报工算利润列
     * @return 结果
     */
    @Override
    public int insert(GoodsSaledoGongxuUserLirun entity) {
        if(StringUtils.isBlank(entity.getId())){
            entity.setId(IdUtils.fastSimpleUUID());
        }
                entity.setCreateBy(SecurityUtils.getUsername());
                entity.setCreateTime(DateUtils.getNowDate());
            return goodsSaledoGongxuUserLirunMapper.insert(entity);
    }

    /**
     * 修改报工算利润列
     * @param entity 报工算利润列
     * @return 结果
     */
    @Override
    public int update(GoodsSaledoGongxuUserLirun entity) {
                entity.setUpdateBy(SecurityUtils.getUsername());
                entity.setUpdateTime(DateUtils.getNowDate());
        return goodsSaledoGongxuUserLirunMapper.update(entity);
    }

    /**
     * 批量删除报工算利润列
     * @param ids 需要删除的报工算利润列主键
     * @return 结果
     */
    @Override
    public int deleteByIds(String[] ids) {
        return goodsSaledoGongxuUserLirunMapper.deleteByIds(ids);
    }

    /**
     * 删除报工算利润列信息
     * @param id 报工算利润列主键
     * @return 结果
     */
    @Override
    public int deleteById(String id) {
        return goodsSaledoGongxuUserLirunMapper.deleteById(id);
    }
}
